export default {
    mobile:async (rule, value) => {
        if (value === '' || !value) {
          return Promise.resolve();
        } else if (/^(1[3-9][0-9])\d{8}$/.test(value)) {
          return Promise.resolve();
        } else {
          return Promise.reject('手机格式不正确');
        }
    },
    email:async (rule, value) => {
        if (value === '' || !value) {
          return Promise.resolve();
        } else if (/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(value)) {
          return Promise.resolve();
        } else {
          return Promise.reject('邮箱格式不正确');
        }
    },
}